using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 作业2
{
    class Program
    {
        static bool correct(int a)
        {
            if (a==1)
            {
                return false;
            }
            for (int i=2;i<a; i++)
            {
                if (a%i==0)
                {
                    return false;
                }
            }
            return true;
        }
        static void Main(string[] args)
        {
            String input = "";
            Console.WriteLine("数字以空格隔开");
            input=Console.ReadLine();
            String[] inputint=input.Split(' ');
            int a,b;
            int.TryParse(inputint[0], out a);
            int.TryParse(inputint[1], out b);
            int count = 0;
            for(int i=a;i<=b;i++)
            {
                if (correct(i))
                {
                    Console.Write("{0}", i);
                    count++;
                    if (count % 10 == 0)
                    {
                        Console.WriteLine();
                    }
                    else
                    {
                        Console.Write(",");
                    }
                }
            }
        }
    }
}
